define(function(require, exports){
	var $			= require('jquery');
	var pubjs		= require('pubjs');
	var baseGrid	= require('@base/highGrid').base;
	var util        = require('util');

	var Base = baseGrid.extend({
		init: function(config){
			config = pubjs.conf(config, {
				'cols': [
					{name: "modelId", text: "id", width: 50, align: "center" },
					{name: "name", text: LANG("名称"), width: 150, render: 'renderName'},
					{name: "last", text: LANG('新数据'), render: 'renderData', align: "left", width: 500},
					{name: "old", text: LANG('旧数据'), render: 'renderData', align: "left", width: 500},
					{name: "TS", text: LANG('时间'), render: 'renderTime', width: 150, align: 'center'},
					{name: "extra.loginId", text: LANG("登陆id"), render: 'renderLoginId', width: 50},
					{name: "extra.operatorId", text: LANG("账号id"), render: 'renderOperatorId', width: 50}
				]
				,"hasSearch": false
				,"hasTab": false
				,"hasExport": false
				,"hasAmount": false
				,"hasRefresh": true
				,"hasFilter": false
				,"hasMenu": false
				,"auto_load": false
				,"url": 'operationlog/list'
				,"reqType": 'websocket'
				,"gridName": 'operationlog'
			});

			this.Super('init', arguments)
		},
		renderName: function(i, val)
		{
			return '<div class="uk-text-truncate w150" title="'+ val +'">'+ val +'</div>';
		},
		renderData: function(i, val)
		{
			return '<div style="word-break:break-all;word-wrap: break-word;white-space: normal;">' + JSON.stringify(val) + '</div>';
		},
		renderLoginId: function(i, val, data)
		{
			return data.extra.loginId;
		},
		renderOperatorId: function(i, val, data)
		{
			return data.extra.operatorId;
		},
		renderTime: function(i, val, data)
		{
			return util.date('Y.m.d-H:i:s', val);
		}
	});

	exports.base = Base;
});